package org.example.rowing.vo;

import lombok.Data;

import java.util.Objects;

@Data
public class CompositeKey {
    private final String group;
    private final String gender;
    private final String raceName;
    private final String raceType;

    public CompositeKey(String group, String gender, String raceName, String raceType) {
        this.group = group;
        this.gender = gender;
        this.raceName = raceName;
        this.raceType = raceType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CompositeKey that = (CompositeKey) o;
        return Objects.equals(group, that.group) &&
                Objects.equals(gender, that.gender) &&
                Objects.equals(raceName, that.raceName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(group, gender, raceName);
    }
}